Operating Systems DeMYSTiFieD by Ann McIver McHoes & Joli Ballew

Operating Systems DeMYSTiFieD by Ann McIver McHoes & Joli Ballew

Author:Ann McIver McHoes & Joli Ballew
Language: eng
Format: epub
Publisher: McGraw Hill LLC
Published: 2012-09-15T00:00:00+00:00


TABLE 7-2 Least Recently Used Policy (Pages Used Least Recently Are Shown with an Asterisk (*))

If we use the same page sequence to test the LRU policy, the results are quite different, as shown in Table 7-2. Assume again that the program instructions on its five pages are referenced in the same order as before: A, B, A, C, A, C, D, C, E.

Using LRU, the pages that were referenced least recently (shown in Table 7-2 with an asterisk) are the first to be swapped out, and the pages that were referenced most recently are the last to be swapped out.

In this case, the processing of the same sequence of five pages using the LRU policy required many fewer page faults—only five page faults (compared to seven page faults for FIFO). Does this mean that LRU is superior to FIFO? Not necessarily. If you notice, this example included a bit of repetition, with Page A and Page C being referenced over and over again. This is an example of a structure that favors LRU, as shown in Table 7-3.

TABLE 7-3 Comparison of FIFO and LRU Examples



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.